from django.urls import path
from .views import *

urlpatterns = [
    # 吐槽列表
    path('spit/', SplitListCreateApiView.as_view({
        'get': 'list',
        'post': 'create'
    })),
    # 收藏,或者取消收藏
    path('spit/<str:pk>/collect/', SplitListCreateApiView.as_view({
        'put': 'update',
    })),
    # 富文本编辑器上传图片
    path('upload/common/', UploadPicture.as_view()),
    # 点赞或取消点赞
    path('spit/<str:pk>/updatethumbup/', UpdateThumbupViewSet.as_view({
        'put': 'update',
    })),
    # 吐槽详情, # 这里需要写id
    path('spit/<str:id>/', SpitdetailModelViewSet.as_view({
        'get': 'retrieve',
    })),
    # 获取吐槽的评论
    path('spit/<str:pk>/children/', CommentSpitListApiView.as_view())
]
